package bigbrother.log.daylog;

import bigbrother.log.logentries.LogEntry;

import java.io.Serializable;
import java.util.List;

/**
 * Contains all the {@link LogEntry}ies from a specific channel for one specific day.
 * <p/>
 * This is the basic unit of disk access and caching.
 *
 * @author Hans Haggstrom
 */
public interface DayLog
        extends Serializable
{
    /**
     * @return unique ID identifying this {@link DayLog}.
     */
    DayLogId getId();

    /**
     * @return a read-only list with the current entries for this day.
     */
    List<LogEntry> getEntries();

    /**
     * Adds a new log entry to this {@link DayLog}.
     *
     * @param logEntry the entry to add.  It should have the correct channel and date.
     */
    void addEntry( LogEntry logEntry );
}
